package com.yongnuo.support;

import java.util.ArrayList;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.yongnuo.remoteconlight.R;

public class ShowAdapter extends BaseAdapter {

	private int count;
	private ArrayList<String> mSet = new ArrayList<String>();
	private LayoutInflater inflater = null;
	
	
	public ShowAdapter(Context mContext,ArrayList<String> mSet) {
		super();
		inflater = (LayoutInflater) mContext
				.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		this.mSet = mSet;
	}

	public ArrayList<String> getmSet() {
		return mSet;
	}

	public void setmSet(ArrayList<String> mSet) {
		this.count = mSet.size();
		this.mSet = mSet;
	}

	public void setCount(int count) {
		this.count = count;
	}
	
	@Override
	public int getCount() {
		return count;
	}
	
	@Override
	public Object getItem(int position) {
		return position;
	}
	
	@Override
	public long getItemId(int position) {
		return position;
	}
	
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		View vi = inflater.inflate(R.layout.device_name, null);
		TextView Name  = (TextView) vi.findViewById(R.id.ShowText);
		Name.setText(mSet.get(position));
		return vi;
	}

}
